import request from '@/utils/request'

// 以下是原有接口（保持不变）
export function getRegionList() {
  return request({
    url: '/dispatch/web/dispatchSiteInfoAdmin/regionList',
    method: 'get'
  })
}

export function getSiteStatusList() {
  return request({
    url: '/dispatch/web/dispatchSiteInfoAdmin/siteStatusList',
    method: 'get'
  })
}

export function getFactoryList() {
  return request({
    url: '/dispatch/web/dispatchSiteInfoAdmin/factoryList',
    method: 'get'
  })
}

export function listSiteInfoAdmin(params) {
  return request({
    url: '/dispatch/web/dispatchSiteInfoAdmin/list',
    method: 'get',
    params
  })
}

export function getSiteInfoAdmin(siteAdminId) {
  return request({
    url: `/dispatch/web/dispatchSiteInfoAdmin/${siteAdminId}`,
    method: 'get'
  })
}

export function addSiteInfoAdmin(data) {
  return request({
    url: '/dispatch/web/dispatchSiteInfoAdmin',
    method: 'post',
    data
  })
}

export function updateSiteInfoAdmin(data) {
  return request({
    url: '/dispatch/web/dispatchSiteInfoAdmin',
    method: 'put',
    data
  })
}

export function deleteSiteInfoAdmin(siteAdminIds) {
  return request({
    url: `/dispatch/web/dispatchSiteInfoAdmin/${siteAdminIds}`,
    method: 'delete'
  })
}

export function getSiteTypeList() {
  return request({
    url: '/dispatch/web/dispatchSiteInfoAdmin/siteTypeList',
    method: 'get'
  })
}

// 以下是新增接口 - 监测量分组管理
// 查询监测量分组列表
export function getMonitorGroupList(id) {
  return request({
    url: '/dispatch/web/dispatchSiteInfoAdmin//group_list/' + id,
    method: 'get'
  })
}

// 新增监测量分组
export function addMonitorGroup(data) {
  return request({
    url: '/dispatch/web/dispatchSiteInfoAdmin/monitor/add',
    method: 'post',
    data
  })
}

// 修改监测量分组
export function updateMonitorGroup(data) {
  return request({
    url: '/dispatch/web/dispatchSiteInfoAdmin/monitor/update',
    method: 'put',
    data
  })
}

// 获取监测量分组详情
export function getMonitorGroupDetail(id) {
  return request({
    url: `/dispatch/web/dispatchSiteInfoAdmin/monitor/${id}`,
    method: 'get'
  })
}

// 删除监测量分组
export function deleteMonitorGroup(id) {
  return request({
    url: `/dispatch/web/dispatchSiteInfoAdmin/monitor/delete/${id}`,
    method: 'delete'
  })
}

// 获取监测量列表信息
export function getMonitoringList(params) {
  return request({
    url: '/dispatch/web/dispatchSiteInfoAdmin/monitoringList',
    method: 'get',
    params
  })
}

// 删除监测量
export function deleteMonitoring(monitorId) {
  return request({
    url: `/dispatch/web/dispatchSiteInfoAdmin/monitoring/delete/${monitorId}`,
    method: 'delete'
  })
}

// 获取监测量下拉列表
export function getMonitoringSelectList(siteId) {
  return request({
    url: `/dispatch/web/dispatchSiteInfoAdmin/select/monitoringList/${siteId}`,
    method: 'get'
  })
}

// 新增监测量到分组
export function addGroupMonitoring(data) {
  return request({
    url: '/dispatch/web/dispatchSiteInfoAdmin/group/monitoring/add',
    method: 'post',
    data
  })
}

// 获取泵组下拉列表
export function getPumpGroupList(siteId) {
  return request({
    url: `/dispatch/web/dispatchSiteInfoAdmin/select/pumpGroupList/${siteId}`,
    method: 'get'
  })
}

// 获取泵组配置详情
export function getPumpGroupConfig(siteId, pumpId) {
  return request({
    url: `/dispatch/web/dispatchSiteInfoAdmin/pumpGroup/${siteId}/${pumpId}`,
    method: 'get'
  })
}

// 保存泵组配置信息
export function savePumpGroupConfig(data) {
  return request({
    url: '/dispatch/web/dispatchSiteInfoAdmin/pumpGroup/add',
    method: 'post',
    data
  })
}